var App = require("../../base/App");
var randomUtils = require("../../utils/randomUtils");
var aTreasure = require("./aTreasure");
var aWatchAd = require("./aWatchAd");
var aWatchVideo = require("./aWatchVideo");
var inTask = require("./inTask");
var common = require("./common");
var xiGua = new App("西瓜视频", {
  interval: 10 * 60,
});
aWatchAd.setStorage(xiGua.storage);
xiGua.run = function () {
  var span = randomUtils.getRandom(2, 5, 60);
  console.log("先看视频", span, "秒");
  aWatchVideo.setSpan(span);
  aWatchVideo.flow();
  if (common.inHome()) {
    sleep(randomUtils.getRandom(2, 15, 1000));
    common.toTask();
    inTask.init();
    sleep(randomUtils.getRandom(1.5, 2, 1000));
    aWatchAd.flow();
    sleep(randomUtils.getRandom(1.5, 2, 1000));
    aTreasure.flow();
  }
};

module.exports = xiGua;
